package com.mc.mcgoweb.thread.threadinterrupt;

public class ThreadServiceTest {
    public static void main(String[] args) {
        long begin = System.currentTimeMillis();
        Runnable runnable = new Runnable() {
            @Override
            public void run() {
                while (true) {
//                    try {
//                        Thread.currentThread().sleep(2000);
//                        break;
//                    } catch (InterruptedException e) {
//                        e.printStackTrace();
//                    }

                }
            }
        };
        ThreadService service = new ThreadService();
        service.execute(runnable);
        service.shutdown(5_000);
        long end = System.currentTimeMillis();
        System.out.println(end - begin);
    }

}
